<template>
    <div class="container">
        <div class="title">商品列表</div>
        <van-grid :column-num="2">
            <van-grid-item  v-for="(item) in list" @click="click(item)" :key="item.goods_id">
                <img class="menu-img" :src="item.goods_image">
                <span class="menu-text">{{ item.goods_name }}</span>
                <!-- <van-text>{{ item.text }}</van-text> -->
            </van-grid-item>
        </van-grid>
    </div>
</template>

<script>
export default {
    props: {
        list: {
            require: false,
            type: Array,
            default: () => {
                return []
            }
        }
    },
    methods: {
        click(item) {
            this.$router.push(`/prodetail/${item.goods_id}`)
        },
    },
}

</script>

<style lang="less" scoped>
.container {
    padding: 0px 15px;


    .title {
        height: 40px;
        line-height: 40px;
    }

    .menu-img {
        width: 140px;
    }

    .menu-text {
        margin-top: 10px;
        font-size: 13px;
    }
}
</style>